# Contributor: Hoang Nguyen <folliekazetani@protonmail.com>
# Maintainer: omni <omni+alpine@hack.org>
maintainer="omni <omni+alpine@hack.org>"
pkgname=passt
pkgver=2024.10.30
_commit=ee7d0b6
_tag=${pkgver//./_}.$_commit
pkgrel=0
pkgdesc="Plug A Simple Socket Transport"
url="https://passt.top/"
# ppc6le: may fail in CI with the message:
#   Failed to close files leaked by parent: Function not implemented
# but should pass on the ppc64le package builder, see 2024-09-12 12:
#   https://irclogs.alpinelinux.org/%23alpine-devel-2024-09.log
arch="all"
license="BSD-3-Clause AND GPL-2.0-or-later"
makedepends="coreutils-fmt linux-headers"
subpackages="$pkgname-doc"
source="https://passt.top/passt/snapshot/passt-$_tag.tar.gz
	include-linux-types.h.patch
	"
builddir="$srcdir/$pkgname-$_tag"

build() {
	make VERSION="$_tag"
}

check() {
	# complicated test setup, requires qemu and a lot of VM images
	# let's just at least do this
	./passt --version
	./pasta --version
}

package() {
	make DESTDIR="$pkgdir" prefix=/usr install
	install -Dm644 LICENSES/*.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
4b7b3b00de37de25df056904f512f7f1f9935ab513209c6550c6b7f820677f69e2e384ed3914c746e94abdf2cfa574c6200298cde2a5ef7e4dceb772cc1560fd  passt-2024_10_30.ee7d0b6.tar.gz
24ada24cf73565565cda67ab9d34fe519c40833ce3351a285ff30260b6f703222d790bca86fc75309e00616f5f7c0cfb3151c96b1b49e3b0a5f57ba79e7525b5  include-linux-types.h.patch
"
